A Tabulation Transformation Tactic Using Haskell Arrays
نویسندگان
چکیده
In this paper we propose a transformation tactic that provides general tabulation of functional algorithms. This tabulation tactic can be applied to dependency graphs in which variable size cuts can be defined. The tactic can be considered a generalization of the tupling tactic proposed by other authors. Tables are dynamically created and their sizes determined at execution time. The tactic is greatly simplified by the use of the data type array present in the functional language Haskell. According to the size of the tables used, two forms of tabulation are distinguished, respectively named total and partial tabulation. Some significative examples are developed using the tactic, including dynamic programming problems. Finally, we apply the loop inversion tactic to the partially tabulated algorithms to show that, in many cases, these algorithms can be transformed into tail recursive versions, similar to their imperative counterparts.
منابع مشابه
Proof Support for General Type Classes
We present a proof rule and an effective tactic for proving properties about Haskell type classes by proving them for the available instance definitions. This is not straightforward, because instance definitions may depend on each other. The proof assistant Isabelle handles this problem for single parameter type classes by structural induction on types. However, this does not suffice for an eff...
متن کاملTrends in Functional Programming
We present a proof rule and an effective tactic for proving properties about HASKELL type classes by proving them for the available instance definitions. This is not straightforward, because instance definitions may depend on each other. The proof assistant ISABELLE handles this problem for single parameter type classes by structural induction on types. However, this does not suffice for an eff...
متن کاملProof support for generic type classes
We present a proof rule and an effective tactic for proving properties about HASKELL type classes by proving them for the available instance definitions. This is not straightforward, because instance definitions may depend on each other. The proof assistant ISABELLE handles this problem for single parameter type classes by structural induction on types. However, this does not suffice for an eff...
متن کاملImperative Functional Programming Brief Summary
Our Haskell compiler has C as its target code. Given a Haskell program performing an I/O loop, the compiler can produce C code which is very similar to that which one would write by hand. Its eeciency is achieved by applying simple program transformations. We use unboxed data types 4] to expose representation and order-of-evaluation detail to code-improving transformations, rather than relying ...
متن کاملI Contents 1 Introduction 1 2 Monolithic Arrays 1 3 from Macs to Double Loops: an Example 4 4 Problem Formulation and Solution Strategy 6
Unimodular transformation has been proposed as a powerful techniques for loop parallelization in imperative language programs. In this paper, we propose to apply unimodular transformation to functional language programs. In particular, we propose a method of applying unimodular transformation to monolithic arrays such as Haskell array comprehensions. Using our method, a compiler can deduce a sa...
متن کامل